;;;Place a revision cloud.
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;	http://www.paracadd.com
;;;	All rights reserved.
;;;
(DEFUN C:CLOUD(/ FIRST SECOND THIRD S)
  (SETVAR "CMDECHO" 0)
  (IF GVPNO NIL (LOAD "GVPNO" "\nFile GVPNO.LSP not loaded! "))
  (gvpno)
  (IF DIMSCL NIL (LOAD "DIMSCL" "\nFile DIMSCL.LSP not loaded! "))
  (dimscl)
  (IF UPOINT NIL (LOAD "UPOINT" "\nFile UPOINT.LSP not loaded! "))
  (IF USTR NIL (LOAD "USTR" "\nFile USTR.LSP not loaded! "))
  (IF UKWORD NIL (LOAD "UKWORD" "\nFile UKWORD.LSP not loaded! "))
  (SETQ usrvars_reghive "HKEY_CURRENT_USER"
        usrvars_regkey (STRCAT "Software\\Autodesk\\AutoCAD\\R" (RTOS (ATOF (GETVAR "acadver"))2 1) "\\ACAD-D000:409\\Profiles\\<<C3D_Imperial>>\\Variables");for <<C3D_Imperial>>
        usrvars_regname_1 "*REVCLOUDMINARCLENGTH"
        usrvars_regname_2 "*REVCLOUDMAXARCLENGTH"
  )
  (SETQ usrvars_regkeys
         (dos_regget
           (STRCAT usrvars_reghive "\\" usrvars_regkey "\\")
         ) ;_ end of dos_regget
  ) ;_ end of SETQ
  (IF (AND
        (MEMBER usrvars_regname_1 usrvars_regkeys)
        (MEMBER usrvars_regname_2 usrvars_regkeys)
      )
    (PROGN
      (SETQ cloudarcs
        (DOS_MSGBOX
          (STRCAT "Current Settings:\nMinimum Arc Length: "
                  (dos_reggetstr usrvars_reghive usrvars_regkey "*REVCLOUDMINARCLENGTH")
                  "\nMaximum Arc Length: "
                  (dos_reggetstr usrvars_reghive usrvars_regkey "*REVCLOUDMAXARCLENGTH")
                  "\n\nDo you want to change these values?"
          )
          "Are Cloud Arc Lengths Wrong?"
          4
          4
        )
      )
      ;Yes=6; No=3
      (IF (EQ cloudarcs 6)
        (PROGN
          (SETQ minarclen (ureal 1 "" "Minimum Arc Length" (RTOS (* 0.25 dimsc) 2 4)))
          (SETQ maxarclen (ureal 1 "" "Maximum Arc Length" (RTOS (* 0.375 dimsc) 2 4)))
        )
        (PROGN
          (SETQ minarclen (RTOS (* 0.25 dimsc) 2 4));1/4" @ current VP scale
          (SETQ maxarclen (RTOS (* 0.375 dimsc) 2 4));3/8" @ current VP scale
        )
      )
    )
    (PROGN
      (SETQ minarclen (ureal 1 "" "Minimum Arc Length" (RTOS (* 0.25 dimsc) 2 4)))
      (SETQ maxarclen (ureal 1 "" "Maximum Arc Length" (RTOS (* 0.375 dimsc) 2 4)))
    )
  )
  (IF C:SVLAYR NIL (LOAD"MKLAYR"))
  (C:SVLAYR)
  (IF
    (OR
      (AND upoint
        (SETQ FOURTH (UPOINT 0 "" "Symbol insertion point" NIL NIL))
      )
      (AND
        (IF UPOINT NIL (LOAD "UPOINT" "\nFile UPOINT.LSP not loaded! "))
        (SETQ FOURTH (UPOINT 0 "" "Symbol insertion point" NIL NIL))
      )
    )
    (PROGN
      (SETQ this_revno (ustr 1 "Revision number" (IF this_revno this_revno "1") nil))
      (SETQ COLR "6" MODF "REVS")
      (C:MKLAYR)
      (SETQ OLD_CLOUD_OSMODE (GETVAR "OSMODE"))
      (SETQ OLD_CLOUD_ATTDIA (GETVAR "ATTDIA"))
      (SETQ OLD_CLOUD_ATTREQ (GETVAR "ATTREQ"))
      (SETVAR "ATTDIA" 0)
      (SETVAR "ATTREQ" 1)
      (SETVAR "OSMODE" 0)
      (COMMAND "INSERT" "H_TAG" FOURTH DIMSC DIMSC (- 0 (* 180.0(/(GETVAR "VIEWTWIST")PI))) this_revno)
      (SETVAR "OSMODE" OLD_CLOUD_OSMODE)
      (SETVAR "ATTDIA" OLD_CLOUD_ATTDIA)
      (SETVAR "ATTREQ" OLD_CLOUD_ATTREQ)
      (SETQ COLR "2" MODF "REVS")
      (C:MKLAYR)
      (PRINC "\nUse command SWAPARCS after cloud placement to reverse arc sides if necesary. ")
      (PRINC)
      (SETQ cloud_opt (ukword 1 "Object Points" "Specify [Object/Points]" (IF cloud_opt cloud_opt "Object")))
      (IF (EQ cloud_opt "Points")
        (COMMAND "REVCLOUD" "S" "N" "A" minarclen maxarclen)
        (COMMAND "REVCLOUD" "S" "N" "A" minarclen maxarclen cloud_opt)
      )
;;;    (SETVAR "CMDECHO" 1)
;;;    (C:RSLAYR)
    );PROGN
  );IF
;;;  (PRINC)
);DEFUN
(DEFUN c:swaparcs ()
  (IF UKWORD NIL (LOAD "UKWORD" "\nFile UKWORD.LSP not loaded! "))
  (SETQ from_cloud T)
  (IF c:unbulgeit NIL (LOAD "BULGEIT" "\nFile BULGEIT.LSP not loaded! "))
  (c:unbulgeit)
  (SETQ from_cloud NIL)
  (PRINC)
)